<?
if ($form->getObject()->isNew()){
	$formUrl=url_for("images_create");
}else{
	$formUrl=url_for("images_update", array("sf_subject" => $form->getObject()));
}
?>

<form action="<?= $formUrl ?>" method="POST" <?= ($form->isMultipart()?'enctype="multipart/form-data"':'') ?>>
	<?= $form->renderGlobalErrors() ?>
	<? if (!$form->getObject()->isNew()):// REST! ?>
		<input type="hidden" name="sf_method" value="PUT" />
	<? else: ?>
		<input type="hidden" name="entry_image[entry_id]" value="<?= $entry->getId() ?>" />
	<? endif ?>


	<?= $form['path']->renderLabel() ?>
	<?= $form['path']->renderError() ?>
	<?= $form['path'] ?>

	<? if (!$form->getObject()->isNew()): ?>
		<?//= link_to('Delete', 'images_delete', $form->getObject(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
	<? endif; ?>
	<input type="submit" value="Save" />
</form>

<?php use_helper("jQuery"); ?>

<form class="inline" action="<?= url_for("images_delete", $entry) ?>" method="POST">
	<input type="hidden" name="sf_method" value="delete" />
	<?= jq_submit_to_remote("Delete", "AJAX Delete", array("url" => url_for("images_delete", array("sf_subject" => $form->getObject(), "sf_format" => "json")))) ?>
	<input type="submit" value="Delete" />
</form>

<form class="inline" action="<?= url_for("images_promote", $form->getObject()) ?>" method="POST">
	<input type="hidden" name="sf_method" value="put" />
	<input type="submit" value="Up" />
	<?= jq_submit_to_remote("Up", "AJAX Up", array("url" => url_for("images_promote", $form->getObject()))) ?>
</form>

<form class="inline" action="<?= url_for("images_demote", $form->getObject()) ?>" method="POST">
	<?= jq_submit_to_remote("Down", "AJAX Down", array("url" => url_for("images_demote", $form->getObject()))) ?>
	<input type="hidden" name="sf_method" value="put" />
	<input type="submit" value="Down" />
</form>






